import { resolve } from "path";

export const DATA_URL = "https://www.ceve-market.org/dumps/evedata.xlsx";

export const SDE_CACHE_PATH = "../";
export const SDE_UN_PACK_DIR = "sde_unpack";
export const SDE_PAGE_URL = "https://developers.eveonline.com/resource/resources";
export const SDE_FILE_TEXT = "Full SDE (sde.zip)";
export const ALL_CHECK_SUM_TEXT = "All Checksums";
export const SDE_FILE_NAME = "sde.zip";
export const ICON_DIR = resolve(SDE_CACHE_PATH, "icons");

const getSDEFile = (file: string) => {
  return resolve(SDE_CACHE_PATH, SDE_UN_PACK_DIR, "fsd", file);
};

const getCacheFile = (file: string) => {
  return resolve(SDE_CACHE_PATH, file);
};

export const SDE_TYPE_MATERIALS_FILE = getSDEFile("typeMaterials.yaml");
export const FORMATED_TYPE_MATERIALS_FILE = getCacheFile("type_materials.json");

export const SDE_TYPE_FILE = getSDEFile("types.yaml");
export const FORMATED_TYPE_FILE = getCacheFile("universe_types.json");

export const FORMATED_CATEGORY_FILE = getCacheFile("categories.json");

export const SDE_BLUEPRINTS_FILE = getSDEFile("blueprints.yaml");
export const FORMATED_BLUEPRINTS_FILE = getCacheFile("blueprints.json");

export const SDE_PLANET_SCHEMATICS_FILE = getSDEFile("planetSchematics.yaml");
export const FORMATED_PLANET_SCHEMATICS_FILE = getCacheFile("planet_schematics.json");

export const SDE_FILE = getCacheFile(SDE_FILE_NAME);
export const SDE_UNPACK_DIR = getCacheFile("sde_unpack");
export const SDE_CHECKSUM_FILE = getCacheFile("checksum.json");
//原始行星资源分组ID
export const PLANT_SCHEMATICS_ORIGINAL_GROUP_ID = 42;
//p1
export const PLANT_SCHEMATICS_LEVEL1_GROUP_ID = 1042;
//p2
export const PLANT_SCHEMATICS_LEVEL2_GROUP_ID = 1034;
//p3
export const PLANT_SCHEMATICS_LEVEL3_GROUP_ID = 1040;
//p4
export const PLANT_SCHEMATICS_LEVEL4_GROUP_ID = 1041;
//蓝图分组ID
export const BLUEPRINTS_GROUP_ID = 9;
//反应物ID
export const REACTION_GROUP_ID = 24;
